//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//

package com.mercury.emqx.client.req;

import com.alibaba.fastjson.annotation.JSONField;
import com.mercury.emqx.model.PayloadMessage;
import lombok.Data;

/**
 * @author mercury
 */
@Data
public class MqttPublishReq {

    private String topic;
    private String topics;
    @JSONField(
            name = "clientid"
    )
    private String clientId;
    private String payload;
    private String encoding = "plain";
    private Integer qos = 2;
    private Boolean retain = false;

    public MqttPublishReq() {
    }

    public MqttPublishReq(PayloadMessage payloadMessage) {
        this.topic = payloadMessage.getTopic();
        this.clientId = payloadMessage.getClientId();
        this.payload = payloadMessage.getPayload();
        this.topics = payloadMessage.getTopics();
        this.qos = payloadMessage.getQos();
        this.retain = payloadMessage.getRetain();
    }


}
